package com.hrt.serial.modbus;


/**
 * 单个Modbus数据封装对象，即从modbus中过来的数据解析后的对象，
 * 这里是单个Modbus数据对象，有时候串口数据存在粘包情况，这个对象只存放粘包处理后的单个Modbus对象
 * 
 * @author gislin
 *
 */
public class ModbusDataModel {

    private String id;

    private int dataLength;

    private double[] data;

    private byte[] sourceData;

    private Object singleData;

    private String plcPointId;

    private Boolean plcIsMeasValue;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public int getDataLength() {
        return dataLength;
    }

    public void setDataLength(int dataLength) {
        this.dataLength = dataLength;
    }

    public double[] getData() {
        return data;
    }

    public void setData(double[] data) {
        this.data = data;
    }

    public byte[] getSourceData() {
        return sourceData;
    }

    public void setSourceData(byte[] sourceData) {
        this.sourceData = sourceData;
    }

    public Object getSingleData() {
        return singleData;
    }

    public void setSingleData(Object singleData) {
        this.singleData = singleData;
    }

    public String getPlcPointId() {
        return plcPointId;
    }

    public void setPlcPointId(String plcPointId) {
        this.plcPointId = plcPointId;
    }

    public Boolean getPlcIsMeasValue() {
        return plcIsMeasValue;
    }

    public void setPlcIsMeasValue(Boolean plcIsMeasValue) {
        this.plcIsMeasValue = plcIsMeasValue;
    }

    @Override
    public String toString() {
        StringBuffer strBuf = new StringBuffer();
        strBuf.append(id);

        for (double value : data) {
            strBuf.append(" " + value);
        }

        return strBuf.toString();
    }

}
